#ifndef DATABASEMANAGER_H
#define DATABASEMANAGER_H

#include <QObject>

namespace Jcr
{

class DatabaseManagerPrivate;
class DatabaseManager : public QObject
{
    Q_OBJECT
public:
    static DatabaseManager* instance();

    bool addModelParams(const QString& modelName, const QStringList& params);
    bool updateModelParams(const QString& modelName, const QStringList& params);
    QStringList modelParams(const QString& modelName);

    bool setModelCnPrice(const QString& modelName, const QString& price);
    bool setModelUsPrice(const QString& modelName, const QString& price);
    bool setModelEuPrice(const QString& modelName, const QString& price);
    bool setModelCountry(const QString& modelName, const QString& country);
    bool setModelType(const QString& modelName, const QString& type);

    bool addBrandModel(const QString& brandName, const QString& model);

    bool addModelVideoLink(const QString& model, const QString& link);
    bool removeModelVideoLink(const QString& link);

    bool addModelVideoTrueLink(const QString& model, const QString& link);
    bool removeModelVideoTrueLink(const QString& link);

    QStringList modelVideoLinks(const QString& modelName);
    QStringList modelNewsLinks(const QString& modelName);
    QStringList modelsWithVideo() const;

    QString brandName(const QString& modelName);
    bool isBrandName(const QString& brandName);

    bool modelParamsExists(const QString& model);
    bool modelTrueVideoLinkExists(const QString& model);

private:
    explicit DatabaseManager(QObject *parent = 0);
    ~DatabaseManager();

    Q_DISABLE_COPY(DatabaseManager)
    DatabaseManagerPrivate* d_ptr;
};

} // namespace Jrc
#endif // DATABASEMANAGER_H
